import { createApp } from 'vue'
import index from '@/index.vue'
import store from '@/store/index'
import router from '@/router/index'
import vant from '@/plugins/vant'
import element from '@/plugins/element'
import '@/assets/css/vant.scss'
import '@/assets/css/global-var.scss'
import '@/assets/css/global.scss'
import * as icons from '@element-plus/icons-vue'
import { ElNotification } from 'element-plus'
import 'element-plus/es/components/notification/style/css'
//环境变量
const env_ = import.meta.env
const env = {
  webUrl: env_.VITE_APP_WEB_URL,
  baseUrl: env_.VITE_APP_WEB_URL,
  publicPath: env_.VITE_APP_WEB_URL,
  apiUrl: env_.VITE_APP_API_URL,
}

const app = createApp(index)

// 全局注册el-icon
Object.keys(icons).forEach(key => {
  app.component(key, icons[key])
})
//配置全局属性

app.config.globalProperties.$notify = ElNotification
app.config.globalProperties.env = env
app.config.globalProperties.isH5Edit = true
app.config.globalProperties.app = app

app.use(router)
app.use(store)
app.use(vant)
app.use(element)
app.mount('#app')
export default app
